#define SEEK_LEFT(index, col) ((index) - 1)
#define SEEK_RIGHT(index, col) ((index) + 1)
#define SEEK_TOP(index, col) ((index) - col)
#define SEEK_BOTTOM(index, col) ((index) + col)
#define SEEK_TOP_LEFT(index, col)\
    SEEK_TOP(SEEK_LEFT(index, col), col)
#define SEEK_TOP_RIGHT(index, col)\
    SEEK_TOP(SEEK_RIGHT(index, col), col)
#define SEEK_BOTTOM_LEFT(index, col)\
    SEEK_BOTTOM(SEEK_LEFT(index, col), col)
#define SEEK_BOTTOM_RIGHT(index, col)\
    SEEK_BOTTOM(SEEK_RIGHT(index, col), col)

#define DEF_COUNT(var)\
    int get##var(CellObject* cells, const Position& pos)\
    {\
        return isAlive(cells[SEEK_##var(pos.getIndex(), pos.getCol())]);\
    }
#ifdef SET
#undef SET
#endif
#define SET(var) DEF_COUNT(var)
